<?php
	session_start();
	$db = new Model_mpro;
	$model = new Model_mdel;
	//$data = $db->user_like_content($uid);
	//debug($data);
	if(isset($_SESSION['ses_userid'])){
		$pro_id = $_POST['pro_id'];
		$uid = $_SESSION['ses_userid'];
		$data = $db->check_like_content($uid,$pro_id);
		if($data == FALSE){
			echo 2;
		}else{
			$data = array(
				"fa_userid" 	=> $uid,
				"pro_id"	=> $pro_id
			);
			$model->insert("tbl_favorites",$data);
		}
	}else{
		echo 1;
	}	
?>